Digital images and video frames are compressed in order to reduce data storage and transmission requirements. In most image compression methods, certain image data is discarded selectively to reduce the amount of data needed to represent the image while avoiding substantial degradation of the appearance of the image.
Transform coding is a common image compression method that involves representing an image by a set of transform coefficients. The transform coefficients are quantized individually to reduce the amount of data that is needed to represent the image. A representation of the original image is generated by applying an inverse transform to the transform coefficients. Block transform coding is a common type of transform coding method. In a typical block transform coding process, an image is divided into small, non-overlapping rectangular regions (or “blocks”), which are subjected to forward transform, quantization and coding operations.
FIG. 1 shows a prior art method of compressing an image 10 in accordance with the JPEG compression format. In this method, if the original image 10 is not already specified in a preselected color space (e.g., the YCrCb color space), the original image 10 is converted into the preselected luminance-based color space (block 12). Each color plane of the image in the preselected color space corresponds to a respective image (i.e., an array of pixel values) that is processed individually as follows. The color components (e.g., the Cr and Cb color components) are downsampled (block 14). Each color plane is divided into blocks of pixels (e.g., 8×8 pixel blocks) (block 16). A DCT block transform is applied to each pixel block individually (block 18). The resulting DCT coefficients are quantized (block 20). In this process, the DCT coefficients are quantized to the closest integer multiples of the quantization parameter values corresponding to the frequencies of the DCT coefficients. That is, a quantized transform coefficient cij for a block is given by:
                                              ⁢                                            c              _                                      i              ⁢                                                          ⁢              j                                =                      round            ⁢                                                                      ⁢                                                                    (                                          c                                  i                  ⁢                                                                          ⁢                  j                                                            q                                  i                  ⁢                                                                          ⁢                  j                                                      )                                              (        1        )            where cij is the (i,j) transform coefficient and qij is the quantization parameter corresponding to the transform coefficient cij. The quantized transform coefficients are encoded using a lossless coding technique to produce a compressed image 22 (block 24).
FIG. 2 shows a prior art method of decompressing the compressed image 22. In this method, the compressed image data is losslessly decoded (block 26). The resulting quantized transform coefficients are dequantized (block 28). These dequantized coefficients ĉij are given by:ĉij=qij· cij  (2)
An inverse DCT block transform is applied to each of the dequantized transform coefficients (block 30). The resulting image blocks are assembled into the constituent color planes of the image (block 32). The color components (e.g., the Cr and Cb color components) are upsampled (block 34). If the image is not is already specified in the final color space (e.g., the RGB color space), the resulting image is converted from the preselected luminance-based color space (e.g., the YCrCb color space) to the final color space to produce the decompressed image 36 (block 38). The values of the original quantization parameters (qij) that were used to compress an image may be used in a variety of ways. For example, the quality of an image often is degraded by a block transform coding process, which may introduce discontinuities at the block boundaries in the reconstructed image and may introduce ringing artifacts near image boundaries. Many artifact reduction methods rely on the original values of the quantization parameters that were used to compress the images in order to reduce the appearance of artifacts that were introduced by block transform coding processes. The original quantization parameters also may be used to recompress an image without introducing additional compression artifacts into the image.
The JPEG compression standard allows the original quantization parameter values that were used to compress an image to be stored in the compressed image file. Many other image formats (e.g., a bitmap format, such as BMP), however, do not retain information about the quantization parameter values. As a result, information about the original quantization parameter values typically is lost in the process of decompressing JPEG images into other formats.
Different methods have been proposed for estimating the original quantization parameter values from a decompressed bitmap image. In general, these methods involve dividing the image into blocks, computing forward transforms of the image blocks, and, after the entire image has been processed, estimating the quantization parameter values based on histograms of the values of the forward transform coefficients in the image blocks. In some approaches, an optimization process (e.g., a maximum likelihood estimation process) is performed to evaluate likelihood functions that compute quantization parameter values by fitting the forward transform coefficient values to a model of the probability distribution function of the forward transform coefficient values.
Although the above-described methods are capable of obtaining estimates of the quantization parameter values, these methods are computationally intensive and require significant memory resources. For example, many of these methods process an entire image before the quantization parameter values are estimated and, therefore, the processing requirements increase with image size. These methods also store the histograms of coefficient values for each of the transform coefficients and, therefore, these methods require significant memory resources. In addition, the optimization processes that are performed by these methods are computationally intensive and therefore are not suitable in application environments, such as embedded environments, in which processing and memory resources are significantly constrained.